Skip to content

feat(cli): integrate Obscura headless browser (required, Apache-2.0)#155

Merged
izo merged 2 commits intomainfrom
claude/integrate-obscura-bHQMm
May 7, 2026
Merged

feat(cli): integrate Obscura headless browser (required, Apache-2.0)#155
izo merged 2 commits intomainfrom
claude/integrate-obscura-bHQMm

Conversation

@izo
Copy link
Copy Markdown
Owner

@izo izo commented May 7, 2026

Summary

Add Obscura (h4ckf0r0day/obscura, Apache-2.0, Rust) as a required CLI alongside shot-scraper, with a clear split:

  • shot-scraper keeps screenshots, PDF, accessibility tree, auth interactive
  • Obscura takes JS eval, multi-URL parallel scraping, CDP server scenarios
  • Rule: visual → shot-scraper, data → Obscura

Per upstream, Obscura is a lightweight headless browser (V8 + CDP, Puppeteer/Playwright compatible, stealth mode): 30 MB RAM (vs 200+ MB Chrome), 70 MB binary (vs 300+ MB), 85 ms page load (vs ~500 ms). Native Rust workers make obscura scrape ~5–10× faster than shot-scraper multi on batches > 20 URLs.

Changes

  • framework/tools/cli-registry.json — new entry, priority: required, category: browser, install per-OS (binary download) + cargo fallback, examples for fetch / scrape / serve.
  • framework/cli/internal/installer/catalog.go--with-obscura ExternalModule with platform-aware install script (uname -s/uname -m → arm64-macos / x86_64-macos / x86_64-linux), cargo fallback for unsupported platforms. Go build + tests pass.
  • framework/agents/_shared/obscura-protocol.md — new shared protocol: install, decision matrix vs shot-scraper, command reference (fetch/scrape/serve), ulk patterns (SEO, alt audit, link check, sitemap crawl), limitations, fallback rule.
  • CLAUDE.md, .claude/rules/install-reference.md — document Obscura adoption (2026-05-07), --with-obscura flag, install methods, the shot-scraper coexistence rule.
  • 4 web-capture agents extended with obscura-protocol and JS eval calls converted from shot-scraper javascript "$URL" "..." to obscura fetch "$URL" --eval "..." (10 sites in visual-auditor, 1 in frontend-qa, 1 in seo-auditor, 1 in agamotto/Penpot).
  • Regenerated framework/agents/registry.{json,md} + framework/commands/ mirrors via cheatheet/generate-{registry,commands}.cjs.

Decision matrix (excerpt from obscura-protocol.md)

Use case Tool Why
Screenshot / PDF / multi-viewport shot-scraper Dedicated API, presets, multi shots.yml
Accessibility tree shot-scraper Obscura has no equivalent
Auth interactive (cookie/session capture) shot-scraper shot-scraper auth
JS eval / DOM extraction Obscura 4–6× faster startup, RAM /6
Multi-URL parallel scraping (>5 URLs) Obscura Native Rust workers (obscura-worker)
CDP server (Puppeteer/Playwright client) Obscura obscura serve --port 9222 --stealth

Test plan

  • python3 -m json.tool framework/tools/cli-registry.json valid
  • go build ./... green in framework/cli/
  • go test ./... green (cmd, config, installer, registry, tui)
  • node framework/cheatheet/generate-registry.cjs regenerates 87 agents
  • node framework/cheatheet/generate-commands.cjs regenerates 95 command files
  • Manual: ./install.sh --with-obscura on macOS arm64 (binary download + obscura --version)
  • Manual: ./install.sh --with-obscura on Linux x86_64
  • Manual: cargo install --git ... fallback path (set unsupported platform)
  • Manual: invoke visual-auditor against a real URL → verify obscura fetch --eval succeeds, screenshots still go through shot-scraper
  • Manual: verify the documented binary asset names (obscura-aarch64-macos.tar.gz, etc.) actually exist on the upstream releases page — fall back to cargo if a release is not yet published

Notes / open points

  • Obscura has no package manager (no brew/apt/npm) — install relies on GitHub releases or cargo. The Go installer attempts the binary first and falls back to cargo install --git automatically.
  • The existing shot-scraper ExternalModule remains opt-in (--with-shot-scraper) per current ulk convention; Obscura follows the same pattern (--with-obscura). The "required" priority in the CLI registry is documentation-level (consumers know it's expected), not enforced at install time.
  • The upstream binary asset URL pattern (releases/latest/download/obscura-<arch>-<os>.tar.gz) is inferred from the README; reviewers should verify these assets exist before merging, or the install will degrade to the cargo fallback.

https://claude.ai/code/session_015HAvQLiLeNyP3LUURaEyeC


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Added Obscura, a headless browser engine for advanced scraping and JavaScript evaluation tasks.
    • Enhanced agents (visual-auditor, frontend-qa, seo-auditor, agamotto) with Obscura integration for improved performance.
    • Added --with-obscura installation option for optional Obscura setup.
  • Documentation

    • Added protocol guidance on choosing between Obscura and shot-scraper tools.
    • Updated agent workflows and setup instructions to reflect Obscura availability and usage.

Add Obscura (h4ckf0r0day/obscura) as a required CLI alongside shot-scraper:
- shot-scraper keeps screenshots, PDF, accessibility tree, auth interactive
- Obscura takes JS eval, multi-URL parallel scraping, CDP server scenarios
- Rule: visual → shot-scraper, data → Obscura

Bench (per upstream): 30 MB RAM (vs 200+ MB Chrome), 70 MB binary (vs 300+ MB),
85 ms page load (vs ~500 ms). V8 + Chrome DevTools Protocol, Puppeteer/Playwright
compatible, stealth mode anti-fingerprinting, native Rust parallel workers.

Changes:
- framework/tools/cli-registry.json: new entry priority=required, category=browser
- framework/cli/internal/installer/catalog.go: --with-obscura ExternalModule
  (binary download per platform, cargo install fallback)
- framework/agents/_shared/obscura-protocol.md: shared protocol with decision
  matrix vs shot-scraper, install, command reference, fallback rule
- CLAUDE.md, .claude/rules/install-reference.md: document Obscura adoption
- 4 web-capture agents extended with obscura-protocol and shot-scraper
  javascript calls converted to obscura fetch --eval:
  - frontend/03-visual-auditor.md (10 call sites)
  - frontend/02-frontend-qa.md
  - audit/32-seo-auditor.md
  - docs/17-agamotto.md (Penpot extraction)

https://claude.ai/code/session_015HAvQLiLeNyP3LUURaEyeC
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8a5cff14-e34a-4ca0-966a-3a1380ec76c2

📥 Commits

Reviewing files that changed from the base of the PR and between d9ac0e2 and 6d03f94.

📒 Files selected for processing (23)
  • .claude/rules/install-reference.md
  • CLAUDE.md
  • framework/agents/_shared/obscura-protocol.md
  • framework/agents/audit/32-seo-auditor.md
  • framework/agents/docs/17-agamotto.md
  • framework/agents/frontend/02-frontend-qa.md
  • framework/agents/frontend/03-visual-auditor.md
  • framework/agents/registry.json
  • framework/agents/registry.md
  • framework/cli/internal/installer/catalog.go
  • framework/commands/agents/agamotto.md
  • framework/commands/agents/seo-auditor.md
  • framework/commands/frontend/frontend-qa.md
  • framework/commands/frontend/visual-auditor.md
  • framework/tests/agents/agathe.golden.md
  • framework/tests/agents/alex.golden.md
  • framework/tests/agents/benjamin.golden.md
  • framework/tests/agents/frontend-orchestrateur.golden.md
  • framework/tests/agents/gandalf.golden.md
  • framework/tests/agents/godspeed.golden.md
  • framework/tests/agents/tools-checker.golden.md
  • framework/tests/cheatheet.test.mjs
  • framework/tools/cli-registry.json

📝 Walkthrough

Walkthrough

This PR introduces Obscura, a Rust-based headless browser engine, as a complementary tool to shot-scraper. It establishes a shared protocol defining when agents should use each tool, registers Obscura in the installer and tool registry, extends multiple agent workflows to adopt Obscura for JS evaluation and parallel scraping, and updates test expectations for agent model variants.

Changes

Obscura CLI Integration

Layer / File(s) Summary
Obscura Protocol Definition
framework/agents/_shared/obscura-protocol.md
Defines the obscura-protocol with decision matrix (when to prefer Obscura vs shot-scraper), installation steps for macOS/Linux/Rust source, core commands (fetch, scrape, serve with CDP), reusable agent patterns, limitations, and migration rules for affected agents.
Tool Installation & Registration
.claude/rules/install-reference.md, CLAUDE.md, framework/cli/internal/installer/catalog.go, framework/tools/cli-registry.json
Adds --with-obscura flag to install.sh, registers Obscura in installer catalog with platform-specific downloads and cargo fallback, and adds Obscura as a required CLI tool in the tool registry with version checks and usage examples.
Agent Protocol Extensions
framework/agents/audit/32-seo-auditor.md, framework/agents/docs/17-agamotto.md, framework/agents/frontend/02-frontend-qa.md, framework/commands/agents/agamotto.md, framework/commands/agents/seo-auditor.md, framework/commands/frontend/frontend-qa.md
Multiple agents and commands extend their configuration to include _shared/obscura-protocol.md, enabling reference to the shared decision matrix and patterns.
SEO Auditor Workflow Updates
framework/agents/audit/32-seo-auditor.md, framework/commands/agents/seo-auditor.md
Phase 3 content analysis switches from shot-scraper javascript to obscura fetch --eval JSON.stringify(...) for production URL extraction with structured JSON output.
Agamotto Extraction Updates
framework/agents/docs/17-agamotto.md, framework/commands/agents/agamotto.md
Penpot data extraction changes to a two-step flow: shot-scraper captures the page, then obscura fetch --eval retrieves window.app?.main?.store?.state instead of shot-scraper javascript.
Frontend QA Tool Split
framework/commands/frontend/frontend-qa.md
Landing mode now explicitly distinguishes tool usage: shot-scraper for screenshots, obscura for DOM/JS evaluation, with reference to the shared decision protocol.
Visual Auditor Agent Updates
framework/agents/frontend/03-visual-auditor.md
Adds Obscura as first-class tool with expanded description, installation/verification steps, and multiple phases updated to use obscura fetch --eval for performance timing, JS error detection, missing assets, and DOM/CSS checks. Includes fallback behavior and error handling when Obscura is unavailable.
Visual Auditor Command Updates
framework/commands/frontend/visual-auditor.md
Substantially expands visual-auditor command documentation with Obscura capabilities, setup/installation procedures, explicit error gates (fail on shot-scraper missing, warn+fallback on Obscura missing), and detailed execution phases preferring Obscura for JS evaluation and parallel scraping.
Registry Metadata Updates
framework/agents/registry.json, framework/agents/registry.md
Updates visual-auditor registry entries to reflect combined shot-scraper + Obscura workflow with enumerated outputs (multi-viewport comparisons, DOM/CSS, accessibility tree, visual performance metrics).
Test Model Expectations
framework/tests/agents/*.golden.md, framework/tests/cheatheet.test.mjs
Golden test fixtures updated to expect different model variants (agathe: sonnet→opus, alex: opus→sonnet, benjamin: sonnet→opus, frontend-orchestrateur: sonnet→opus, gandalf: sonnet→haiku, godspeed: sonnet→haiku, tools-checker: sonnet→haiku). Test validation now accepts haiku as an allowed agent model.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • izo/Ulk#141: Modifies installer/catalog.go and CLI tool registry to add external browser tools, directly related to the Obscura installer and registry integration.
  • izo/Ulk#51: Introduces the CLI/skills infrastructure used by this PR to register Obscura in framework/tools/cli-registry.json and framework/cli/internal/installer/catalog.go.

Poem

🐰 A new browser hops into the warren,
Obscura swift, where data flows like a stream,
Shot-scraper frames, Obscura extracts—
Two tools dance where pixels and JSON meet,
Audits grow sharper, performance gleams!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/integrate-obscura-bHQMm

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.1)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…t policy

Pre-existing test debt surfaced on PR #155 CI:

1. 7 golden files had expect_model: sonnet but the agents were retargeted
   in commit 1d4f351 ("align model selection across 87 agents"):
   - agathe, benjamin, frontend-orchestrateur → opus
   - gandalf, godspeed, tools-checker → haiku
   - alex → sonnet (was previously expected as opus)

2. framework/tests/cheatheet.test.mjs:73 had validModels = ['opus', 'sonnet'],
   missing 'haiku' which was introduced for godspeed/gandalf/tools-checker.

Both test suites now pass (610 golden + 30 cheatheet asserts).

The Go CLI coverage gate (70%) is left untouched — pre-existing on this
branch (38%) and on main (55%); fixing it requires substantial test
additions out of scope for the Obscura PR.

https://claude.ai/code/session_015HAvQLiLeNyP3LUURaEyeC
@izo izo marked this pull request as ready for review May 7, 2026 17:48
@izo izo merged commit f5812a4 into main May 7, 2026
3 of 6 checks passed
@izo izo deleted the claude/integrate-obscura-bHQMm branch May 7, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants